package com.tchhy.provider.rx

import android.view.View
import io.reactivex.ObservableEmitter
import io.reactivex.ObservableOnSubscribe

class ButtonSingleClickSubScribe(view: View) : ObservableOnSubscribe<View> {

    init {
        view.setOnClickListener { mEmitter?.onNext(it) }
    }

    private var mEmitter: ObservableEmitter<View>? = null

    override fun subscribe(emitter: ObservableEmitter<View>) {
        this.mEmitter = emitter
    }
}